package cc.opcol.iot.app;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;

@ConfigurationProperties(prefix = "file")
@Configuration
public class AppConfiguration {
    @Value("${iot.port}")
    private int iotPort=5180;

    @Value("${url.auth}")
    private boolean urlAuth=false;

    @Value("${auth.patterns}")
    private String authUrlPatterns="/api/*";

    private long sessionTimeOutTime=1000*60*20;

    @Value("${login.url}")
    private String loginUrl="/login.html";

    public int getIotPort() {
        return iotPort;
    }

    public void setIotPort(int iotPort) {
        this.iotPort = iotPort;
    }

    public boolean isUrlAuth() {
        return urlAuth;
    }

    public void setUrlAuth(boolean urlAuth) {
        this.urlAuth = urlAuth;
    }

    public String getAuthUrlPatterns() {
        return authUrlPatterns;
    }

    public void setAuthUrlPatterns(String authUrlPatterns) {
        this.authUrlPatterns = authUrlPatterns;
    }

    public long getSessionTimeOutTime() {
        return sessionTimeOutTime;
    }

    public void setSessionTimeOutTime(long sessionTimeOutTime) {
        this.sessionTimeOutTime = sessionTimeOutTime;
    }

    public String getLoginUrl() {
        return loginUrl;
    }

    public void setLoginUrl(String loginUrl) {
        this.loginUrl = loginUrl;
    }
}
